/**
 * 
 */
package com.game.db;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author lushouzhi
 *
 */
public class DbManager {
	private static DbManager dbManager = null;
	private ApplicationContext context = null;
	private GameWorldDao worldDAO = null;
	
	public static DbManager getInstance() {
		if (dbManager == null) {
			dbManager = new DbManager();
		}
		return dbManager;
	}
	
	public void init() {
		context = new ClassPathXmlApplicationContext("applicationContext.xml");
		worldDAO = (GameWorldDao)context.getBean("gameWorldDao");
	}

	public GameWorldDao getWorldDAO() {
		return worldDAO;
	}
}
